package org.example.exp2.entity;

import lombok.Getter;
import lombok.Setter;
import org.example.exp2.common.Links;

@Getter
@Setter
public class BookVO {

    private int bookId;
    private String title;
    private String author;
    private String isbn;
    private boolean available;

    // 构造函数、getter 和 setter 方法
    public BookVO(int bookId, String title, String author, String isbn, boolean available) {
        this.bookId = bookId;
        this.title = title;
        this.author = author;
        this.isbn = isbn;
        this.available = available;
    }

    private Links links;

    public void setLinks(String baseUri) {
        this.links = new Links(baseUri + "/books/" + this.bookId); // 使用bookId生成链接
    }
}